
f = figure();
j=0;
figcount = 0 ;
for k=[1 2 5 6]
    j=j+1;
    figcount = figcount + 1;
    subplot(4,4,figcount)
    thistitle = string(NAMES(k));
    bar(MidEst(k,:),FreqEst(k,:))
    title(thistitle);
    set(gcf,'position',[20 50*j 1000 500])%bottom, left width and height of figure
end
j=0;
for k=[3 4 7 8]
    j=j+1;
    figcount = figcount + 1;
    subplot(4,4,figcount)
    thistitle = string(NAMES(k));
    bar(MidEst(k,:),FreqEst(k,:))
    title(thistitle);
    set(gcf,'position',[40 50*j 1000 500])%bottom, left width and height of figure
end
j=0;
for k=9:12
    j=j+1;
    figcount = figcount + 1;
    subplot(4,4,figcount)
    thistitle = string(NAMES(k));
    bar(MidEst(k,:),FreqEst(k,:))
    title(thistitle);
    set(gcf,'position',[60 50*j 1000 500])%bottom, left width and height of figure
end
j=0;
for k=13:16
    j=j+1;
    figcount = figcount + 1;
    subplot(4,4,figcount)
    thistitle = string(NAMES(k));
    bar(MidEst(k,:),FreqEst(k,:))
    title(thistitle);
    set(gcf,'position',[80 50*j 1000 500])%bottom, left width and height of figure
end

fileName = horzcat(modelname, '.png');
fileName=join(fileName, "");
saveas(f,fileName);

    
